<template>
  <div>
      <h4>个人订单详情</h4>
      订单号: {{orderObj.id}}<br><br>
      收货人: {{orderObj.consignee}}<br><br>
      收货地址: {{orderObj.address}}<br><br>
    收货人电话: {{orderObj.phone}}<br><br>
    下单时间: {{orderObj.orderDate}}<br><br>
    订单总价: {{orderObj.totalPrice}}<br><br>
    订单状态: {{orderObj.status}}<br>
    <h4>订单明细</h4>
    <el-table :data="orderObj.detailList" style="width: 100%" border="1">
      <el-table-column prop="productBean.id" label="商品编号"  />
      <el-table-column prop="productBean.name" label="商品名" />
      <el-table-column prop="productBean.price" label="单价" />
      <el-table-column prop="buyNum" label="购买数量" />
    </el-table>
    <el-button type="primary" @click=" this.$router.push('/myOrder')">返回</el-button>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      orderObj:{}
    }
  },methods:{
    findById(orderId){
    axios.get("/project/order/findById",{params:{orderId}}).then(resp=> {
      this.orderObj = resp.data;
    });
  }
  },created() {
    let orderId=sessionStorage.getItem("id");
    this.findById(orderId);
  }
}
</script>

<style scoped>

</style>